{__NOLAYOUT__}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
	{include file="public/script" /}
</head>
<body class="">
	<div class="sectionH  sectionH2 mui-clearfix">
		<header class="mui-bar mui-bar-nav" style="">
			<a class="mui-icon mui-icon-left-nav  mui-pull-left" href="javascript:history.back(-1)" style="color: #727272;"></a>
			<h1 class="mui-title">支付</h1>
			<!--<a class="mui-icon mui-pull-right right1" href="assets-1.html"><img src="images/icon_setting.png"/></a>-->
		</header>
	</div>
	<div class="kong1"></div>
	<div class="pay_section1">
		<div class="container">
			<div class="pay_section1_1">
				<div class="div1 mui-clearfix">
					<div class="left1"><img src="{$info.thumb}"/></div>
					<div class="left2">
						<p class="p1">{$info.title}</p>
						<p class="p2">活动时间：{$info.begintime|show_datetime}--{$info.endtime|show_datetime}</p>
					</div>
				</div>
				<div class="div2 mui-clearfix">
					<p class="p1">报名人：</p>
					<p class="p2">{$user.real_name}</p>
				</div>
				<div class="div3 mui-clearfix">
					<p class="p1">你需支付：</p>
					<p class="p2"><span>{$info.coin}</span> H链币 + <span>{$info.money}</span> 元</p>
				</div>
			</div>
		</div>
	</div>
	<div class="pay_section2">
		<form action="" method="post" id="submit">
			<div class="pay_section2_1">
				<div class="container">
					<p>请选择支付方式：</p>
				</div>
			</div>
			<div class="pay_section2_2 mui-clearfix">
				<div class="container mui-clearfix">
					<div class="left1">
						<img src="__STATIC__/www/images/pay_icon_hc.png"/> <span>H链币</span>
					</div>
					<div class="right1">
						<p class="p1"><span class="coin">{$info.coin}</span>
							<!--<input type="checkbox" name="" id="" value="" checked=""/>-->
						</p>
						<p class="p2">当前可用：<span class="mycoin">88</span></p>
					</div>
				</div>
			</div>
			<div class="ge"></div>
			<div class="pay_section2_3">
				<ul>
					<!--<li class="mui-clearfix">-->
						<!--<label for="weixin">-->
							<!--<div class="container mui-clearfix">-->
								<!--<div class="left1">-->
									<!--<img src="__STATIC__/www/images/pay_icon_weixin.png"/> <span>微信支付</span>-->
								<!--</div>-->
								<!--<div class="right1">-->
									<!--<input type="radio" name="mon" id="weixin" data-value="1" checked=""/>-->
								<!--</div>-->
							<!--</div>-->
						<!--</label>-->
					<!--</li>-->
					<li class="mui-clearfix">
						<label for="alipay">
							<div class="container mui-clearfix">
								<div class="left1">
									<img src="__STATIC__/www/images/pay_icon_alipay.png"/> <span>支付宝</span>
								</div>
								<div class="right1">
									<input type="radio" name="mon" id="alipay" data-value="2" />
								</div>
							</div>
						</label>
					</li>
				</ul>
			</div>
			
			
			<div class="sub">
				<div class="container">
					<input style="color:#fff;" id="btn" type="button" value="立即支付"/>
				</div>
			</div>
		</form>
	</div>
</body>
<script>
	$('#btn').click(function () {
	    var is_app="{$is_app}";
	    var active_id="{$info.id}";
	    /*所需H链*/
		var coin=$('.coin').val();
		/*所需支付的金额*/
        // var money=$('.money').val();
		/*我的H链*/
		var mycoin=$('.mycoin').html();
		if(coin>mycoin)
		{
		    mui.alert("您的H链钱包不够！");
		    return false;
		}
		var paytype=$("input[name='mon']:checked").attr('data-value');
		var url="{:url('Resource/resourcePay')}";
		$.post(url,{mycoin:mycoin,paytype:paytype,active_id:active_id},function(data){
            var data=JSON.parse(data);
            if(data.status==0)
            {
                /*android手机*/
                if(is_app==1)
                {
                    android.readyPay(pay_type,data.info);
                }else if(is_app==2){

                    /*苹果手机*/

                }else{
                    mui.alert("非法操作！");return false;
                }

            }else{
                mui.alert("支付失败");return false;
            }
		})

    })
	/*支付成功回调*/
	function androidPayReturn(res) {
		if(res==1)
		{
		    window.location.href="/User/myorder";
		}else{
			mui.alert("激活失败！");return false;
		}
    }
</script>
</html>